//
//  ZqlMainVC.m
//  ZqlChangDian
//
//  Created by 赵乾龙 on 16/4/29.
//  Copyright © 2016年 Mr.zhao. All rights reserved.
//

#import "ZqlMainVC.h"
#import "ZqlHomeVC.h"
#import "ZqlMyVC.h"
#import "ZqlCustomVC.h"
#import "ZqlOrderVC.h"
#import "ZqlNavVC.h"


@interface ZqlMainVC ()

@end

@implementation ZqlMainVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self addChildViewControllers];
}

- (void)addChildViewControllers{
    ZqlHomeVC *homeVC = [[ZqlHomeVC alloc]init];
    [self addChildViewControllerWithVC:homeVC andTitle:@"" andImageName:@"tabbar_home"];
    ZqlCustomVC *customVC = [[ZqlCustomVC alloc]init];
    [self addChildViewControllerWithVC:customVC andTitle:@"定制" andImageName:@"tabbar_message_center"];
    ZqlOrderVC *orderVC = [[ZqlOrderVC alloc]init];
    [self addChildViewControllerWithVC:orderVC andTitle:@"订单" andImageName:@"tabbar_discover"];
    ZqlMyVC *myVC = [[ZqlMyVC alloc]init];
    [self addChildViewControllerWithVC:myVC andTitle:@"我" andImageName:@"tabbar_profile"];
}

- (void)addChildViewControllerWithVC:(UIViewController *)VC andTitle:(NSString *)title andImageName:(NSString *)imageName{
    ZqlNavVC *nav = [[ZqlNavVC alloc]initWithRootViewController:VC];
    VC.title = title;
    VC.tabBarItem.image = [UIImage imageNamed:imageName];
    [self addChildViewController:nav];
    
}





@end
